package io.renren.modules.api.controller;

import io.renren.modules.notice.entity.PsNoticeEntity;
import io.renren.modules.notice.service.PsNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 通知公告
 *
 * @author xy
 * @email sunlightcs@gmail.com
 * @date 2018-07-19
 */
@RestController
@RequestMapping("/api")
public class ApiNoticeController {
    @Autowired
    private PsNoticeService psNoticeService;

    @PostMapping("selectNoticeList")
    public Map<String, Object> selectNoticeList(){
        Map<String,Object> map = new HashMap<String,Object>();
        List<PsNoticeEntity> psNoticeList = psNoticeService.queryAll();
        map.put("code",0);
        map.put("msg","查询成功");
        map.put("psNoticeList",psNoticeList);
        map.put("type","1");
        return map;
    }
}
